feat: generate TypedDict types for input-side models#738
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #738 +/- ##
==========================================
- Coverage 95.89% 95.70% -0.19%
==========================================
Files 45 48 +3
Lines 5115 5218 +103
==========================================
+ Hits 4905 4994 +89
- Misses 210 224 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f63bb00 to
00f228a
Compare
Contributor
Author
|
@Pijukatel @janbuchar Let me guys know what you think, this change also has some drawbacks:
|
Pijukatel
reviewed
Apr 20, 2026
janbuchar
reviewed
Apr 20, 2026
Pijukatel
reviewed
Apr 21, 2026
aa1c2ab to
8c286c0
Compare
janbuchar
approved these changes
Apr 23, 2026
Add TypedDict counterparts for generated Pydantic models so users passing plain dicts to resource-client methods get full type-checker support without importing Pydantic models. Closes #666. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
770be11 to
074ad0e
Compare
Pijukatel
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
TypedDictcounterparts for input-side models so users passing plain dicts to resource-client methods get full type-checker support without importing Pydantic models.datamodel-code-generatorpass (--output-model-type typing.TypedDict) inpoe generate-models._models_generated.py/_typeddicts_generated.py. Hand-written_models.py/_typeddicts.pynow only hold shapes not exposed by the OpenAPI spec (e.g.RequestInput,RequestInputDict).scripts/postprocess_generated_models.pyto trim the TypedDict file to input-relevant classes (plus transitive deps), rename them with aDictsuffix, and add@docs_group('Typed dicts').actor,task,task_collection,request_queue) to acceptTypedDict | PydanticModelunions..rules.mdandmanual_regenerate_models.yamlto reflect the new layout.Closes #666.